Workspace: Fix dojo challenge import resolve#975
Workspace: Fix dojo challenge import resolve#975ConnorNelson wants to merge 4 commits intomasterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dojo_plugin/api/v1/docker.py
Outdated
| DojoChallenges.query.filter_by(id=challenge_id) | ||
| .join(DojoModules.query.filter_by(dojo=dojo, id=module_id).subquery()) | ||
| .first() | ||
| ) | ||
| if not dojo_challenge: | ||
| return {"success": False, "error": "Invalid challenge"} | ||
| ).resolve() | ||
| dojo = dojo_accessible(dojo_challenge.dojo_id) if dojo_challenge else None |
There was a problem hiding this comment.
Guard resolve when challenge lookup fails
RunDocker.post now calls .resolve() directly on the result of the challenge query. When the provided dojo/module/challenge combination is invalid the query returns None, so the subsequent .resolve() raises an AttributeError and the endpoint responds with a 500 instead of the expected {success: False, "Invalid challenge"} payload. Adding a None check before resolving restores the previous graceful error handling and avoids turning user input mistakes into server errors.
Useful? React with 👍 / 👎.
No description provided.